//
//  DataUtils.h
//  Exchange
//
//  Created by PENGL on 2017/4/27.
//  Copyright © 2017年 ETCWIN. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>
#include <CommonCrypto/CommonCryptor.h>



@interface DataUtils : NSObject

// MD5加密
+ (NSString *)md5Code:(NSString *)str;

// 生成UUID
+ (NSString *)uuid;

// DES加   二进制base64加密
+ (NSString *)encryptUseDESBase64:(NSString *)plainText key:(NSString *)key;

//解密
+ (NSString *)decryptUseDESBase64:(NSString*)cipherText key:(NSString*)key;

// 转二进制
+ (NSString *)dataTohexString:(NSData*)data;

// Base64加密
+(NSString *)encode:(NSData *)data;

// Base64解密
+(NSData *)decode:(NSString *)data;

// NSDictionary To JSON NSString
+ (NSString *)dicToJSON:(NSDictionary *)dic;

@end
